package impl

import (
	"gitee.com/zatto/project/tree/master/vblog/api/apps"
	"gitee.com/zatto/project/tree/master/vblog/api/apps/blog"
	"gitee.com/zatto/project/tree/master/vblog/api/apps/tag"
	"gitee.com/zatto/project/tree/master/vblog/api/conf"
	"gorm.io/gorm"
)

type impl struct {
	blog blog.Service
	db   *gorm.DB
}

func (i *impl) Name() string {
	return tag.AppName
}

func (i *impl) Init() error {
	i.blog = apps.GetInternalApp(blog.AppName).(blog.Service)
	i.db = conf.C().MySQL.ORM().Debug()
	return nil
}

func init() {
	apps.Registry(&impl{})
}
